/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"88BFE639-3F15-40CC-B1CE-2E53833575EB"}
 * @AllowToRunInFind
 */
function onShow(firstShow, event) {

	// Establecemos la valueList con los valores de los menús padre
	var sql_query = "SELECT s_descripcion, adm_t900_menus_id " + 
								"FROM adm_t900_menus " + 
								"WHERE adm_t900_menus_padre_id is null";
	/** @type {JSDataSet} */
	var dataset = databaseManager.getDataSetByQuery(globals.$NOMBRE_SERVIDOR, sql_query, null, -1);
	application.setValueListItems("custom_vlst_adm_t900_menus_padre", dataset);
}

/**
 * @properties={typeid:24,uuid:"3865B337-6720-416C-86A5-37D9EEADAF37"}
 */
function aceptar_siguiente_antes(){
	
	// Salvar datos
	globals.saveEdits_foundset(forms[controller.getName()].foundset);
	// Datos Aceptar / Siguiente
	var _adm_t900_menus_padre_id = adm_t900_menus_padre_id;
	// Nuevo Registro
	foundset.newRecord();
	adm_t900_menus_padre_id = _adm_t900_menus_padre_id;
}
